#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>

// lrc 行歌词结构
struct LrcWordLine
{
    LrcWordLine(qint64 lrcTime, QString lrcContent)
    {
        this->lrcTime = lrcTime;
        this->lrcContent = lrcContent;
    }

    qint64 lrcTime;
    QString lrcContent;
};

namespace Ui {
class LrcPage;
}

class LrcPage : public QWidget
{
    Q_OBJECT

public:
    explicit LrcPage(QWidget *parent = nullptr);
    ~LrcPage();

    bool parseMusicLrcFile(const QString& lrcFilePath);
    void showLrcWordLine(qint64 time);
    int getLrcWordLineIndex(qint64 time);
    QString getLrcWordLine(int index);

    void setMusicName(const QString& musicName);
    void setMusicSinger(const QString& musicSinger);

signals:
    void setLrcAmination();

private:
    Ui::LrcPage *ui;

    QVector<LrcWordLine> lrcWordLines;
};

#endif // LRCPAGE_H
